<?php
/*
数据组件
*/
class Com_data extends Acan{
	function __construct($ainfo=null){
		parent::__construct();
		$this->model = Afun_db()->model($ainfo);
	}
	//数据
	function datas($con='',$page=''){
		if(!empty($page)){
			$page->counts = $this->model->count($con);	//统计总数目
			if(empty($page->theurl)) $page->theurl = $this->aurl_a."/*";
			//分页结束
			$page->other = Afun_url_other();
			$pages = Afun_apage($page);
			if(empty($con->order)) $con->order = "a.$pages->orderby";
			if(empty($con->limit)) $con->limit = $pages->limit;
		}
		$pages->models = $this->model->ofindAll($con);
		return $pages;
	}
}
?>